package views;

import views.panels.PanelGeneral;
import logicBusiness.LaboratorioBL;
import models.Laboratorio;
import java.awt.BorderLayout;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

/**
 *
 * @author vanessa
 */
public class InterfazAdministrarLaboratorio extends javax.swing.JFrame {

    private LaboratorioBL laboratoriobo;

    /** Creates new form InterfazAdministrarLaboratorio */
    @SuppressWarnings("empty-statement")
    public InterfazAdministrarLaboratorio() {


        initComponents();
        PanelGeneral panel = new PanelGeneral();
        this.add(panel, BorderLayout.SOUTH);

        /*Cambio el ancho de las columnas de la tabla jTable1*/

        laboratoriobo = new LaboratorioBL();
        this.inicializarTablaLaboratorio();

    }

    private void inicializarTablaLaboratorio() {
        List<Laboratorio> listaLaboratorio = laboratoriobo.findAll();
        int numfilas = listaLaboratorio.size();

        TConsultarLab.setModel((TableModel) new DefaultTableModelImpl(
                new Object[numfilas][5],
                new String[]{
                    "Número", "Nombre", "Capacidad", "Descirpcion", "Disponible"
                }));

        for (int indicefilas = 0; indicefilas < numfilas; indicefilas++) {
//            this.TConsultarLab.setValueAt(listaLaboratorio.get(indicefilas).getIdLaboratorio(), indicefilas, 0);
//            this.TConsultarLab.setValueAt(listaLaboratorio.get(indicefilas).getnombreLab(), indicefilas, 1);
//            this.TConsultarLab.setValueAt(listaLaboratorio.get(indicefilas).getcapacidadlab(), indicefilas, 2);
//            this.TConsultarLab.setValueAt(listaLaboratorio.get(indicefilas).getdescripcionLab(), indicefilas, 3);
//            this.TConsultarLab.setValueAt(listaLaboratorio.get(indicefilas).getdisponibildaLab(), indicefilas, 4);


        }
    }

    private class DefaultTableModelImpl extends DefaultTableModel {

        public DefaultTableModelImpl(Object[][] arg0, Object[] arg1) {
            super(arg0, arg1);
        }
        boolean[] canEdit = new boolean[]{false, true, true, true, true, true};

        @Override
        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
        }
    }

    private void borrarDatoLaboratorio() {
        Integer idLaboratorio = (Integer) TConsultarLab.getValueAt(TConsultarLab.getSelectedRow(), 0);

        Integer confirmar = JOptionPane.showOptionDialog(this, "Esta seguro que desea "
                + "Eliminar el Laboratorio ",
                "Confirmar eliminar Laboratorio",
                JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE,
                null, new Object[]{"Si", "No, deseo volver"}, "Si");
        if (confirmar == 0) {
            int d = laboratoriobo.borrarLaboratorio(idLaboratorio);

            inicializarTablaLaboratorio();
        }
    }

    private void ActualizarDatos() {
        Integer idLaboratorio = (Integer) TConsultarLab.getValueAt(TConsultarLab.getSelectedRow(), 0);
        String nombreLab = (String) TConsultarLab.getValueAt(TConsultarLab.getSelectedRow(), 1);
        Integer capacidadLab = (Integer) TConsultarLab.getValueAt(TConsultarLab.getSelectedRow(), 2);
        String descripcionLab = (String) TConsultarLab.getValueAt(TConsultarLab.getSelectedRow(), 3);
        String disponibilidadLab = (String) TConsultarLab.getValueAt(TConsultarLab.getSelectedRow(), 4);

        Integer confirmar = JOptionPane.showOptionDialog(this, "Esta seguro que desea "
                + "Actualizar el Laboratorio ",
                "Confirmar Actualizar Laboratorio",
                JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE,
                null, new Object[]{"Si", "Cancelar"}, "Si");
        if (confirmar == 0) {
            int d = laboratoriobo.actualizarLaboratorio(idLaboratorio, capacidadLab,
                    nombreLab, descripcionLab, disponibilidadLab);

            inicializarTablaLaboratorio();
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jLabel7 = new javax.swing.JLabel();
        PanelCrearLab = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        CTNomLaboratorio = new javax.swing.JTextField();
        CTCapacidad = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        BCrearLab = new javax.swing.JButton();
        CTDescripcion = new javax.swing.JTextField();
        CTNumeroLab = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        CBDisponiblidad = new javax.swing.JComboBox();
        PanelConsultarLab = new javax.swing.JPanel();
        BActualizarTabla = new javax.swing.JButton();
        BEliminarLaboratorio = new javax.swing.JButton();
        SPConsultarLab = new javax.swing.JScrollPane();
        TConsultarLab = new javax.swing.JTable();
        BActualizarDatos = new javax.swing.JButton();
        BCancelar = new javax.swing.JButton();

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/escudo.jpg"))); // NOI18N

        PanelCrearLab.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Creación de Laboratorio", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); // NOI18N
        PanelCrearLab.setToolTipText("Creacion de Laboratorios");
        PanelCrearLab.setDebugGraphicsOptions(javax.swing.DebugGraphics.NONE_OPTION);
        PanelCrearLab.setEnabled(false);

        jLabel1.setText("Nombre del  laboratorio");

        jLabel3.setText("Capacidad ");

        BCrearLab.setFont(new java.awt.Font("Tahoma", 1, 11));
        BCrearLab.setText("Crear Laboratorio");
        BCrearLab.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BCrearLabActionPerformed(evt);
            }
        });

        CTNumeroLab.setEditable(false);
        CTNumeroLab.setForeground(new java.awt.Color(240, 240, 240));
        CTNumeroLab.setBorder(null);

        jLabel8.setText("Descripción:");

        jLabel4.setText("Disponible");

        CBDisponiblidad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No", "SI" }));

        javax.swing.GroupLayout PanelCrearLabLayout = new javax.swing.GroupLayout(PanelCrearLab);
        PanelCrearLab.setLayout(PanelCrearLabLayout);
        PanelCrearLabLayout.setHorizontalGroup(
            PanelCrearLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelCrearLabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(PanelCrearLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PanelCrearLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(PanelCrearLabLayout.createSequentialGroup()
                            .addGroup(PanelCrearLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel1)
                                .addComponent(jLabel3)
                                .addComponent(jLabel4)
                                .addComponent(jLabel8))
                            .addGap(51, 51, 51)
                            .addGroup(PanelCrearLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(CTNomLaboratorio, javax.swing.GroupLayout.DEFAULT_SIZE, 549, Short.MAX_VALUE)
                                .addComponent(CTCapacidad, javax.swing.GroupLayout.DEFAULT_SIZE, 549, Short.MAX_VALUE)
                                .addComponent(CTDescripcion, javax.swing.GroupLayout.DEFAULT_SIZE, 549, Short.MAX_VALUE)
                                .addComponent(CBDisponiblidad, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(27, 27, 27))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelCrearLabLayout.createSequentialGroup()
                            .addComponent(CTNumeroLab, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap()))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelCrearLabLayout.createSequentialGroup()
                        .addComponent(BCrearLab)
                        .addGap(27, 27, 27))))
        );
        PanelCrearLabLayout.setVerticalGroup(
            PanelCrearLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelCrearLabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(PanelCrearLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CTNomLaboratorio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelCrearLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(CTCapacidad, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(PanelCrearLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PanelCrearLabLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(PanelCrearLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(CBDisponiblidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(PanelCrearLabLayout.createSequentialGroup()
                        .addGap(15, 15, 15)
                        .addComponent(CTNumeroLab, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelCrearLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8)
                    .addComponent(CTDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
                .addComponent(BCrearLab)
                .addContainerGap())
        );

        PanelConsultarLab.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Consultar Laboratorio", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); // NOI18N

        BActualizarTabla.setFont(new java.awt.Font("Tahoma", 1, 11));
        BActualizarTabla.setText("Actualizar Tabla");
        BActualizarTabla.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BActualizarTablaActionPerformed(evt);
            }
        });

        BEliminarLaboratorio.setFont(new java.awt.Font("Tahoma", 1, 11));
        BEliminarLaboratorio.setText("Eliminar Laboratorio");
        BEliminarLaboratorio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BEliminarLaboratorioActionPerformed(evt);
            }
        });

        TConsultarLab.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Título 1", "Título 2", "Título 3", "Título 4"
            }
        ));
        SPConsultarLab.setViewportView(TConsultarLab);
        TConsultarLab.getColumnModel().getColumn(0).setResizable(false);
        TConsultarLab.getColumnModel().getColumn(1).setResizable(false);
        TConsultarLab.getColumnModel().getColumn(2).setResizable(false);
        TConsultarLab.getColumnModel().getColumn(3).setResizable(false);

        BActualizarDatos.setFont(new java.awt.Font("Tahoma", 1, 11));
        BActualizarDatos.setText("Actualizar Datos");
        BActualizarDatos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BActualizarDatosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout PanelConsultarLabLayout = new javax.swing.GroupLayout(PanelConsultarLab);
        PanelConsultarLab.setLayout(PanelConsultarLabLayout);
        PanelConsultarLabLayout.setHorizontalGroup(
            PanelConsultarLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelConsultarLabLayout.createSequentialGroup()
                .addGroup(PanelConsultarLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(PanelConsultarLabLayout.createSequentialGroup()
                        .addGap(57, 57, 57)
                        .addComponent(BActualizarTabla)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(BEliminarLaboratorio)
                        .addGap(103, 103, 103)
                        .addComponent(BActualizarDatos, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, PanelConsultarLabLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(SPConsultarLab, javax.swing.GroupLayout.PREFERRED_SIZE, 687, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(92, Short.MAX_VALUE))
        );

        PanelConsultarLabLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {BActualizarDatos, BActualizarTabla, BEliminarLaboratorio});

        PanelConsultarLabLayout.setVerticalGroup(
            PanelConsultarLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelConsultarLabLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(SPConsultarLab, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelConsultarLabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(BActualizarTabla)
                    .addComponent(BEliminarLaboratorio)
                    .addComponent(BActualizarDatos))
                .addContainerGap())
        );

        BCancelar.setFont(new java.awt.Font("Tahoma", 1, 11));
        BCancelar.setText("Cancelar ");
        BCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BCancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel7)
                .addGap(23, 23, 23)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(PanelCrearLab, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(PanelConsultarLab, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(35, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(662, Short.MAX_VALUE)
                .addComponent(BCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(64, 64, 64))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(PanelCrearLab, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(PanelConsultarLab, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(BCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        PanelCrearLab.getAccessibleContext().setAccessibleName("Nombre");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BCrearLabActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BCrearLabActionPerformed
        if (CTNomLaboratorio.getText().equals("") || CTCapacidad.getText().equals("")
                || CTDescripcion.getText().equals("")) {
            JOptionPane.showMessageDialog(this, "Debe digitar los datos completos "
                    + "para crear un Laboratorio", null, JOptionPane.ERROR_MESSAGE);
        } else {
            LaboratorioBL bo = new LaboratorioBL();
            int ok = bo.crearLaboratorio(Integer.parseInt(CTCapacidad.getText()), CTNomLaboratorio.getText(),
                    CTDescripcion.getText(), CBDisponiblidad.getSelectedItem().toString());

            CTNomLaboratorio.setText("");
            CTCapacidad.setText("");
            CBDisponiblidad.getSelectedItem();
            CTDescripcion.setText("");
            if (ok == 1) {

                JOptionPane.showMessageDialog(this, "Se ha creado el Laboratorio "
                        + "con exito", "Creacion exitosa !!!", JOptionPane.INFORMATION_MESSAGE);
                this.inicializarTablaLaboratorio();
            } else {
                JOptionPane.showMessageDialog(this, "Ocurrio un error al crear"
                        + " el Laboratorio", "Creacion fallida", JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_BCrearLabActionPerformed

    private void BActualizarDatosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BActualizarDatosActionPerformed

        if (TConsultarLab.getSelectedRow() != (-1)) {
            ActualizarDatos();
        } else {
            JOptionPane.showMessageDialog(this, "Lo sentimos!\n\nNo ha escogido un"
                    + "Laboratorio para Borrarr",
                    "Laboratorio Desconocido", JOptionPane.ERROR_MESSAGE);
        }


        /* if ( jtable.getSelectedRow()== -1) {
        JOptionPane.showMessageDialog(this, "Debe seleccionar uno de los Laboratorios de la lista ",
        null, JOptionPane.ERROR_MESSAGE);
        } else {
        LaboratorioBL bo= new LaboratorioBL();
        int id = bo.encontrarLaboratorio(jtable.getSelectedRow());
        if (id != 0) {

        int  ok = bo.actualizarLaboratorio(jtable.getSelectedRow());


        textNombre.setText("");
        textCapacidad.setText("");
        jComboBox1.setSelectedIndex(0);
        textDescripcion.setText("");
        if (ok == 1) {
        JOptionPane.showMessageDialog(this, "Se ha Actualizado el aula con exito", "Actualizacion exitosa", JOptionPane.INFORMATION_MESSAGE);
        } else {
        JOptionPane.showMessageDialog(this, "Ocurrio un error al editar el aula", "Actualizacion fallida =(", JOptionPane.ERROR_MESSAGE);
        }
        }
        }*/

        inicializarTablaLaboratorio();
    }//GEN-LAST:event_BActualizarDatosActionPerformed

    private void BCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BCancelarActionPerformed
        this.setVisible(false);
    }//GEN-LAST:event_BCancelarActionPerformed

    private void BActualizarTablaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BActualizarTablaActionPerformed
        inicializarTablaLaboratorio();
    }//GEN-LAST:event_BActualizarTablaActionPerformed

    private void BEliminarLaboratorioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BEliminarLaboratorioActionPerformed

        if (TConsultarLab.getSelectedRow() != (-1)) {
            borrarDatoLaboratorio();
        } else {
            JOptionPane.showMessageDialog(this, "Lo sentimos!\n\nNo ha escogido un"
                    + "Laboratorio para Borrarr",
                    "Laboratorio Desconocido", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_BEliminarLaboratorioActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new InterfazAdministrarLaboratorio().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BActualizarDatos;
    private javax.swing.JButton BActualizarTabla;
    private javax.swing.JButton BCancelar;
    private javax.swing.JButton BCrearLab;
    private javax.swing.JButton BEliminarLaboratorio;
    private javax.swing.JComboBox CBDisponiblidad;
    private javax.swing.JTextField CTCapacidad;
    private javax.swing.JTextField CTDescripcion;
    private javax.swing.JTextField CTNomLaboratorio;
    private javax.swing.JTextField CTNumeroLab;
    private javax.swing.JPanel PanelConsultarLab;
    private javax.swing.JPanel PanelCrearLab;
    private javax.swing.JScrollPane SPConsultarLab;
    private javax.swing.JTable TConsultarLab;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    // End of variables declaration//GEN-END:variables
}
